package com.pktechan.api.service;

import com.pktechan.api.base.BaseService;
import com.pktechan.api.dto.WxPayOrderReq;
import com.pktechan.api.dto.WxPayOrderResp;
import com.pktechan.api.entity.WxPayOrder;

import java.util.Map;

public interface WxPayOrderService extends BaseService<WxPayOrder> {
    /**
     * 添加微信支付订单
     *
     *
     * @param map
     * @param paraMap
     * @return
     */
    void addWxPayOrder(Map<String, String> map, Map<String, String> paraMap);

    /**
     * 生成交易流水号
     *
     * @return
     */
    String createId();

    /**
     * 根据传递给微信的支付流水号查询支付订单
     *
     * @param outTradeNo
     * @return
     */
    WxPayOrder getByOutTradeNo(String outTradeNo);

    /**
     * 更新支付结果
     *
     * @param resultMap
     * @return
     */
    void updateWxPayOrder(Map<String, String> resultMap);

    /**
     * 批量查询微信支付订单状态
     *
     * @return
     */
    void queryWxPayOrderList();

    /**
     * 申请退款
     *
     * @param outTradeNo
     * @return
     */
    void refundWxPayOrder(String outTradeNo) throws Exception;

    /**
     * 微信统一下单接口
     *
     * @param wxPayOrderReq
     * @return
     */
    WxPayOrderResp doUnifiedOrder(WxPayOrderReq wxPayOrderReq);

    /**
     * 根据订单ID查询微信支付下单ID
     *
     * @param wxPayOrderReq
     * @return
     */
    WxPayOrderResp getPrepayIdByTradeOrderId(WxPayOrderReq wxPayOrderReq);
}
